/**
 * Created by zhaiyunzhi on 2017/1/3.
 */
import api from './config'

export function hasStudent(phone) {
    return api.post('api/student/hasStudent',
        {phone:phone});
}

export function createStudent(param) {
    return api.post('api/student/createStudent',{
        realname:param.realname,
        phone:param.phone,
        email:param.email,
        school:param.school,
        school_subject:param.school_subject,
        school_grade:param.school_grade,
        dealer_id:param.dealer_id,
        intent_product_id:param.intent_product_id,
        intent_city_id:param.intent_city_id,
        grade_id:param.grade_id,
        subject_id:param.subject_id,
        type:param.type,
        more:param.more
    });
}
export function deleteStudent(student_id) {
    return api.post('api/student/deleteStudent',{
        student_id:student_id
    });
}

export function updateStudentBase(param) {
    return api.post('api/student/updateStudentBase',{
        student_id:param.student_id,
        realname:param.realname,
        phone:param.phone,
        email:param.email,
        school:param.school,
        school_subject:param.school_subject,
        school_grade:param.school_grade,
        dealer_id:param.dealer_id,
        intent_product_id:param.intent_product_id,
        intent_city_id:param.intent_city_id,
        grade_id:param.grade_id,
        subject_id:param.subject_id,
        type:param.type,
        more:param.more
    });
}

export function getStudentList(param) {
    return api.post('api/student/getStudentList',{
       page_index:param.page_index,
       page_size:param.page_size,
       dealer_id:param.dealer_id,
       school:param.school,
       written_result:param.written_result,
       interview_result:param.interview_result,
       intent_product_id:param.intent_product_id,
       is_regist:param.is_regist,
       type:param.type,
       phone:param.phone,
    });
}

export function getStudentDetail(student_id) {
    return api.post('api/student/getStudentDetail',{
        student_id:student_id
    });
}

export function getStudentChatList(student_id) {
    return api.post('api/student/getStudentChatList',{
        student_id:student_id
    });
}

export function addStudentChat(param) {
    return api.post('api/student/addStudentChat',{
        student_id:param.student_id,
        info:param.info,
        chat_time:param.chat_time
    });
}

